*** Gender: Robustness checks, year 1 performance.  Table 7


clear
use "${data}cleaned_data_y3.dta"
do "${blocks}construct_new_variables"

* Main

reg ns_std_perc_y1 i.type i.Course_NatSci_split  i.ApplyCollege if EEMP == 1, vce(robust)
onesided 2.type
estadd local course_fe "\checkmark"
estadd local apply_college_fe "\checkmark"
estadd local apply_year_fe ""
estadd local exam_year_fe ""
eststo r1
		
* Mixed colleges

drop if OfferCollege == 14
drop if OfferCollege == 16
drop if OfferCollege == 17

reg ns_std_perc_y1 i.type i.Course_NatSci_split  i.ApplyCollege if EEMP==1, vce(robust)
onesided 2.type
estadd local course_fe "\checkmark"
estadd local apply_college_fe "\checkmark"
eststo r2
		
* Controls
clear
use "${data}cleaned_data_y3.dta"
do "${blocks}construct_new_variables"

reg ns_std_perc_y1 i.type i.Course_NatSci_split  i.ApplyCollege home eu independent maintained if EEMP==1, vce(robust)
onesided 2.type
estadd local course_fe "\checkmark"
estadd local apply_college_fe "\checkmark"
eststo r3

* Year FE

reg ns_std_perc_y1 i.type i.Course_NatSci_split i.ApplyCollege i.ApplyYear if EEMP==1, vce(robust)
onesided 2.type
estadd local course_fe "\checkmark"
estadd local apply_college_fe "\checkmark"
estadd local apply_year_fe "\checkmark"
eststo r4

* Marginal

 reg ns_std_perc_y1 i.marginal_male i.Course_NatSci_split  i.ApplyCollege if same_college == 1 & WinterPool == 1, vce(robust)
onesided 2.marginal_male
estadd local course_fe "\checkmark"
estadd local apply_college_fe "\checkmark"
eststo r5

* Split by subject group

areg ns_std_perc_y1 i.marginal_male i.Course_NatSci_split  if same_college == 1 & WinterPool == 1 & EEMP==1, vce(robust) a(ApplyCollege) 
onesided 2.marginal_male
estadd local course_fe "\checkmark"
estadd local apply_college_fe "\checkmark"
eststo r6

areg ns_std_perc_y1 i.marginal_male i.Course_NatSci_split if same_college == 1 & WinterPool == 1 & EEMP==0, vce(robust) a(ApplyCollege) 
onesided 2.marginal_male
estadd local course_fe "\checkmark"
estadd local apply_college_fe "\checkmark"
eststo r7


esttab r1 r2 r3 r4 r5 r6 r7 using "${tables}gender_robustness.tex", cells(b(pval(pval) fmt(2)) se(par fmt(2))) keep(2.type 2.marginal_male)  collabels(none) star(* 0.10 ** 0.05 *** 0.01) ///
scalars("course_fe Subject FE" ///
"apply_college_fe Application college FE" ///
"apply_year_fe Application year FE") ///
eqlabels(none) label varwidth(25) nonumbers posthead("& Main & Mixed &  Controls &  Year FE & Marginal & Marginal & Marginal \\" "& (1) & (2) & (3) & (4) & (5) & (6) & (7) \\ \midrule") nonumbers mlabels(none) se(%9.2f) ///
mgroups("All subjects" "MI"  "non-MI", pattern(1 0 0 0 0 1 1) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
gaps booktabs nonotes replace
